# @File ：HeroFactory.py
# -*- ecoding: utf-8 -*-
# @Time: 2021/8/21 13:59
# @Author: wangyang
from Hero import Timo, Jinx

"""
英雄工厂类，创建实例化英雄
"""
class HeroFactory:
    def create_hero(self,hero_name):
        """
        传入英雄名称，创建对应英雄子类
        :param hero_name:
        :return:
        """
        if hero_name == 'Timo':
            return Timo()
        if hero_name == 'Jinx':
            return Jinx()
        else:
            raise Exception('此英雄不在英雄工厂中')

